<?php 
echo $this->Html->scriptBlock(" 
    	$(document).ready(function() {
    		var tn1 = $('.$article_slug').tn3({
    		    skinDir:'skins',
    		    autoplay:true,
    		    width:230,
    		    height:260,
    		    delay:5000,
    		    imageClick:'fullscreen',
    		    image:{
    			crop:true,
    			transitions:[{
    			    type:'blinds',
    			    duration:300
    			    },
    			    {
    			    type:'grid',
    			    duration:160,
    			    gridX:9,
    			    gridY:7,
    			    easing:'easeInCubic',
    			    sort:'circle'
    			    },{
    			    type:'slide',
    			    duration:430,
    			    easing:'easeInOutExpo'
    			    }]
    		    }
    		    });
    	});
		",$options = array('allowCache'=>false,'safe'=>false,'inline'=>false)); 
?>
		
	<?php if(isset($gallery) && !empty($gallery) || isset($download_files) && !empty($download_files)){?>
    <div class="<?php echo $article_slug ?>">
        <div class="tn3 album">
             <ol>
             	<?php 
             	foreach ($gallery as $key => $image){
             		if(is_numeric($key)){
	           	?>
            	<li>
        		    <?php  echo $this->Html->link($this->Html->image('/files/upload/images/'.$image['Upload']['name'],array('width'=>35,'height'=>35,'alt'=>$image['Upload']['description'],'title'=>$image['Upload']['description'])),'/files/upload/images/'.$image['Upload']['name'],array('escape'=>false,'title'=>$image['Upload']['description']));?>
                </li>
            	<?php }}?>
            	
            	<?php 

             	foreach ($download_files as $key => $file){
             		if(is_numeric($key)){
	           	?>
            	<li>
	            	
	            	<div class="tn3 description"><?php echo __d('competitions','added:',true).' '.$file['Upload']['created']?></div>
        		    <?php  echo $this->Html->link($this->Html->image('/files/upload/images/download_file.png',array('alt'=>$file['Upload']['description'],'title'=>$file['Upload']['description'])),'/files/upload/images/download_bg.png',array('escape'=>false,'title'=>$file['Upload']['description'],'onclick'=>"document.location='/files/upload/images/{$file['Upload']['name']}'"));?>
        		    <h4><?php echo $this->Html->link($this->Html->image('/files/upload/images/download_file.png',array('style'=>'vertical-align: middle;')).$file['Upload']['description'],'/files/upload/images/'.$file['Upload']['name'],array('escape'=>false))?></h4>
                </li>
            	<?php }}?>
            </ol>
        </div>
    </div> 
    <?php }?>